package com.qyj.guiyangdemo.util;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeUtility {
    public static Timestamp getTime() {
        Date date = new Date(System.currentTimeMillis());
        // 将格式化后的日期字符串转换为 Timestamp
        try {
            return new Timestamp(date.getTime());
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public static void main(String[] args) {
        Timestamp time = getTime();
        System.out.println("Time: " + time);
    }
}